/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.model.exchange;

import com.kmcsoft.goldshop.model.master.DiamondColor;
import com.kmcsoft.goldshop.model.master.DiamondGroup;
import com.kmcsoft.emaster.entity.TrackableEntity;
import com.kmcsoft.goldshop.model.master.Currency;
import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.FetchGroups;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 *
 * @author kmcsoft02
 */
@PersistenceCapable(detachable = "true", table = "EXC_DiamondExchangeDetail")
@FetchGroups(value = {
    @FetchGroup(name = "detach_DiamondExchangeDetail_All", members = {
        @Persistent(name = "diamondGroup"),
        @Persistent(name = "diamondColor"),
        @Persistent(name = "currency")}),
    @FetchGroup(name = "detach_DiamondExchangeDetail_DiamondGroup", members = {
        @Persistent(name = "diamondGroup")}),
    @FetchGroup(name = "detach_DiamondExchangeDetail_Currency", members = {
        @Persistent(name = "currency")}),
    @FetchGroup(name = "detach_DiamondExchangeDetail_DiamondColor", members = {
        @Persistent(name = "diamondColor")})
})
public class DiamondExchangeDetail extends TrackableEntity {

    @Persistent
    private DiamondGroup diamondGroup;
    @Persistent
    private DiamondColor diamondColor;
    @Persistent
    private Currency currency;
    @Persistent
    private double sellingPrice;

    public DiamondExchangeDetail() {
    }

    public DiamondExchangeDetail(Currency currency) {
        this.currency = currency;
    }
    
    public DiamondExchangeDetail(DiamondExchangeDetail detail) {
        this.currency=detail.getCurrency();
        this.diamondColor=detail.getDiamondColor();
        this.diamondGroup=detail.getDiamondGroup();
        this.sellingPrice=detail.getSellingPrice();
    }
    
    public DiamondGroup getDiamondGroup() {
        return diamondGroup;
    }

    public void setDiamondGroup(DiamondGroup diamondGroup) {
        this.diamondGroup = diamondGroup;
    }

    public DiamondColor getDiamondColor() {
        return diamondColor;
    }

    public void setDiamondColor(DiamondColor diamondColor) {
        this.diamondColor = diamondColor;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setCurrency(Currency currency) {
        this.currency = currency;
    }

    public double getSellingPrice() {
        return sellingPrice;
    }

    public void setSellingPrice(double sellingPrice) {
        this.sellingPrice = sellingPrice;
    }

    @Override
    public boolean equals(Object obj) {
        return this == obj;
    }
}
